home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / batch / ronset21 / ronset.doc < prev    next >
Text File  |  1990-03-04  |  33KB  |  841 lines

  1.  
  2.                             RONSET
  3.                             ------
  4.  
  5.                         Batch file enhancer
  6.                         Copyright (C) Ron Bemis 1990
  7.                         All rights reserved
  8.                         Version 2.1
  9.                           
  10.  
  11. I use DOS environment variables extensively, and I wanted a better way to
  12. set and use them.  I couldn't find it, so I wrote it myself.  Here it is -
  13. my idea of the ultimate batch file utility.  It lets you set environment
  14. variables to whatever you like... with brains.  It does what DOS should
  15. have done.  This program is the equivalent of the internal DOS SET command,
  16. but it's much more powerful.  You can use it just like you use SET.
  17.  
  18. I hope you'll enjoy this program, and I also hope that you'll consider
  19. sending in a registration if you like it.  Please let me know if you find
  20. something that doesn't work like you think it should.  Also, please let me
  21. know if you think of any enhancements for this program.
  22.  
  23.                  - Ron Bemis, FidoNet 124/1113, 214-213-3841
  24.  
  25. RONSET is shareware!  That means that if you use it on a regular basis, you
  26. must pay for it.  You are hereby granted a limited licence to use this
  27. program for a period of one month.  At the end of this month, you must
  28. either register this program or discontinue its use.  This program may NOT
  29. be used in a business, for-profit organization, or corporate environment
  30. without first being registered.  Registration price for this program is $20
  31. per machine.  Registrations should be mailed to:
  32.  
  33.                Ron Bemis
  34.                9601 Forest Ln #222
  35.                Dallas, TX  75243
  36.  
  37.  
  38. Happy batchin'!
  39.  
  40.  
  41. By the time you're done playing with this program, you should understand
  42. what the following line does and how it works:
  43.  
  44. RONSET fname=low(concat(hex(string(Net:,5)),hex(string(Node:,5))).REQ)
  45.  
  46. At least try each function by itself on the command line to see how they
  47. work.  Satisfy yourself that each function does work as you think it
  48. should.  I think there's about a zillion things you can do with this
  49. program if you cut loose with the creative juices.
  50.  
  51. The above illustrates how you can "nest" RONSET commands to execute a number
  52. of them at the same time and with respect to the same environment variable. 
  53. But we're gettin' ahead of ourselves, here. 
  54.  
  55.  
  56.         COMMAND SYNTAX:
  57.  
  58. RONSET variable_name=function(parameters)
  59.  
  60.         In which:
  61.  
  62. variable_name   is replaced by the name of the environment variable you
  63.                 want to create or replace;
  64.  
  65. function        is any one of the many functions listed in this
  66.                 documentation;
  67.  
  68. (parameters)    are additional commands you give to RONSET.  These commands
  69.                 are dependent upon the function you have asked for.
  70.  
  71. All function parameters MUST be enclosed entirely within parenthesis as
  72. shown above. In this documentaiton, the word "parameter" refers to whatever
  73. it is you're enclosing within the parenthesis.
  74.  
  75.  
  76. Arithmetic functions
  77. --------------------
  78. All arithmetic is done with floating point numbers.
  79.  
  80. add(addend,addend)
  81.     returns the sum of the two values
  82.         Example:                            Result:
  83.         RonSet Sum=add(15,32)               SUM=47
  84.  
  85. sub(minuend,subtrahend)
  86.     returns the difference of the two values
  87.         Example:                            Result:
  88.         RonSet Diff=sub(19,25)              DIFF=-6
  89.  
  90. mult(multiplicand,multiplier)
  91.     returns the product of the two values
  92.         Example:                            Result:
  93.         RonSet Prod=mult(15,32)             PROD=480
  94.  
  95. div(dividend,divisor)
  96.     returns the quotient of the two values
  97.         Example:                            Result:
  98.         RonSet Quot=div(100,7)              QUOT=14.2857
  99.  
  100. eq(x,y)
  101.     returns 1 if x is equal to y, 0 otherwise
  102.         Example:                            Result:
  103.         RonSet X=eq(5,6)                    X=0
  104.         RonSet X=eq(5,5)                    X=1
  105.  
  106. ne(x,y)
  107.     returns 1 if x is not equal to y, 0 otherwise
  108.         Example:                            Result:
  109.         RonSet X=ne(5,6)                    X=1
  110.         RonSet X=ne(5,5)                    X=0
  111.  
  112. lt(x,y)
  113.     returns 1 if x is less than y, 0 otherwise
  114.         Example:                            Result:
  115.         RonSet X=lt(5,6)                    X=1
  116.         RonSet X=lt(5,5)                    X=0
  117.         RonSet X=lt(6,5)                    X=0
  118.  
  119. le(x,y)
  120.     returns 1 if x is less than or equal to y, 0 otherwise
  121.         Example:                            Result:
  122.         RonSet X=le(5,6)                    X=1
  123.         RonSet X=le(5,5)                    X=1
  124.         RonSet X=le(6,5)                    X=0
  125.  
  126. gt(x,y)
  127.     returns 1 if x is greater than y, 0 otherwise
  128.         Example:                            Result:
  129.         RonSet X=gt(5,6)                    X=0
  130.         RonSet X=gt(5,5)                    X=0
  131.         RonSet X=gt(6,5)                    X=1
  132.  
  133. ge(x,y)
  134.     returns 1 if x is greater than or equal to y, 0 otherwise
  135.         Example:                            Result:
  136.         RonSet X=ge(5,6)                    X=0
  137.         RonSet X=ge(5,5)                    X=1
  138.         RonSet X=ge(6,5)                    X=1
  139.  
  140. abs(x)
  141.     returns the absolute value of x
  142.         Example:                            Result:
  143.         RonSet X=abs(-5)                    X=5
  144.         RonSet X=abs(10)                    X=10
  145.         RonSet X=abs(-2.3)                  X=2.3
  146.  
  147. mod(x,y)
  148.     returns x modulo y
  149.         Example:                            Result:
  150.         RonSet Rmn=mod(15,4)                RMN=3
  151.         RonSet Rmn=mod(20,4)                RMN=0
  152.         RonSet Rmn=mod(17,13)               RMN=4
  153.  
  154. neg(x)
  155.     returns negative x
  156.         Example:                            Result:
  157.         RonSet Neg=neg(15)                  NEG=-15
  158.         RonSet Neg=neg(-7.3)                NEG=7.3
  159.  
  160. sqr(x)
  161.     returns x squared
  162.         Example:                            Result:
  163.         RonSet Big=sqr(83)                  BIG=6889
  164.         RonSet Big=sqr(-100)                BIG=10000
  165.         RonSet Big=sqr(23.5)                BIG=552.25
  166.  
  167. sqrt(x)
  168.     returns the square root of x
  169.         Example:                            Result:
  170.         RonSet Root=sqrt(9)                 ROOT=3
  171.         RonSet Root=sqrt(8.7)               ROOT=2.94958
  172.  
  173. pow(x,y)
  174.     returns x to the y power
  175.     this one is an exception to the rules about errorlevels
  176.     if invalid values are specified, a different type of error message (one
  177.     from the floating point run-time library) is displayed, and the program
  178.     may abort with an errorlevel other than 255.
  179.         Example:                            Result:
  180.         RonSet OneK=pow(2,10)               ONEK=1024
  181.         RonSet Big=pow(7,5)                 BIG=16807
  182.  
  183.  
  184. Binary functions
  185. ----------------
  186. All binary functions are done with 16-bit unsigned numbers.
  187.  
  188. and(x,y)
  189.     returns the bitwise AND of x and y
  190.         Example:                            Result:
  191.         RonSet X=and(14,7)                  X=6
  192.  
  193. or(x,y)
  194.     returns the bitwise OR of x and y
  195.         Example:                            Result:
  196.         RonSet X=or(14,7)                   X=15
  197.  
  198. xor(x,y)
  199.     returns the bitwise XOR of x and y
  200.         Example:                            Result:
  201.         RonSet X=xor(14,7)                  X=9
  202.  
  203. not(x)
  204.     returns the 1's complement of x
  205.         Example:                            Result:
  206.         RonSet X=not(14)                    X=65521
  207.  
  208. hex(x)
  209.     returns the 4-digit hexidecimal equivalent of x
  210.         Example:                            Result:
  211.         RonSet X=hex(124)                   X=007C
  212.         RonSet X=hex(1113)                  X=0459
  213.  
  214. oct(x)
  215.     returns the 6-digit octal equivalent of x
  216.         Example:                            Result:
  217.         RonSet O=oct(29127)                 O=070707
  218.         RonSet O=oct(4096)                  O=010000
  219.  
  220. bin(x)
  221.     returns the 16-digit binary equivalent of x
  222.         Example:                            Result:
  223.         RonSet B=oct(29127)                 B=0111000111000111
  224.         RonSet B=oct(4096)                  B=0001000000000000
  225.  
  226.  
  227. String functions
  228. ----------------
  229.  
  230. asc(string)
  231.     returns the decimal value of the first ASCII character of string
  232.         Example:                            Result:
  233.         RonSet A=asc(ABCDE)                 A=65
  234.         RonSet A=asc(XYZ)                   A=88
  235.         RonSet A=asc(z)                     A=122
  236.  
  237. concat(x,y,z...)
  238.     returns a string of concatinated strings
  239.         Example:                            Result:
  240.         RonSet X=concat(One, ,Two, ,Three)  X=One Two Three
  241.         RonSet X=concat(hex(124),hex(1113)) STR=007C0459
  242.  
  243.         This last example shows one of RONSET's most powerful functions -
  244.         embedded functions.  Functions can be embedded as deeply as you
  245.         want, you're limited only by DOS's command line length.
  246.  
  247.         To determine the order that RONSET will evaluate an expression,
  248.         start at the left side and look towards the right until you see a
  249.         right parenthesis ')'.  This is the closing parenthesis of the
  250.         first function that will be evaluated.  After the evaluation is
  251.         done, it gets put into the expression and the expression is
  252.         re-evaluated from the beginning.  This continues until all
  253.         functions have been evaluated.
  254.  
  255.         The last example above is evaluated in this order:
  256.  
  257.             concat(hex(124),hex(1113))
  258.                    -------^
  259.             concat(007C,hex(1113))
  260.                         --------^
  261.             concat(007C,0459)
  262.             ----------------^
  263.             007C0459
  264.  
  265.         It sometimes gets a little messy with all those parenthesis, but if
  266.         you miss one or get too many, the error message given by the
  267.         program should be quite helpful in finding the problem.  The
  268.         message displayed will show the part of the line that caused the
  269.         problem, with all earlier parts evaluated.
  270.  
  271.         In many cases, the concat() function is not needed.  The first
  272.         example above:
  273.  
  274.             RonSet X=concat(One, ,Two, ,Three)
  275.  
  276.         could just as easily have been written as:
  277.  
  278.             RonSet X=One Two Three
  279.  
  280.         But the second example:
  281.  
  282.             RonSet X=concat(hex(124),hex(1113))
  283.  
  284.         could not have been written without the concat() function because
  285.         of the order of evaluation.  If you do this:
  286.  
  287.             RonSet X=hex(124)hex(1113)
  288.  
  289.         RONSET will evaluate this expression to "007Chex(1113)" and will
  290.         give you an error message about an unknown function named
  291.         "007Chex".
  292.  
  293. len(string)
  294.     returns the length of 'string'
  295.         Example:                            Result:
  296.         RonSet L=len(Hi There!)             L=9
  297.  
  298. left(size,string)
  299.     returns the leftmost 'size' characters of 'string'
  300.         Example:                            Result:
  301.         RonSet L=left(4,Hi There!)          L=Hi T
  302.  
  303. mid(loc,size,string)
  304.     returns 'size' characters of 'string', starting at 'loc'.
  305.         Example:                            Result:
  306.         RonSet M=mid(4,3,Hi There!)         M=The
  307.  
  308. right(size,string)
  309.     returns the rightmost 'size' characters of 'string'
  310.         Example:                            Result:
  311.         RonSet R=right(4,Hi There!)         R=ere!
  312.  
  313. low(string)
  314.     returns 'string' in lowercase letters
  315.         Example:                            Result:
  316.         RonSet Small=low(Hi There!)         SMALL=hi there!
  317.  
  318. up(string)
  319.     returns 'string' in uppercase letters
  320.         Example:                            Result:
  321.         RonSet Big=up(Hi There!)            BIG=HI THERE!
  322.  
  323. pos(find,string)
  324.     returns the position of substring 'find' in 'string'
  325.     if 'find' is not found in 'string', 0 is returned
  326.     this search is case sensitive
  327.         Example:                            Result:
  328.         RonSet X=pos(The,Hi There!)         X=4
  329.         RonSet X=pos(Hi T,Hi There!)        X=1
  330.         RonSet X=pos(ere!,Hi There!)        X=6
  331.  
  332. replace(old,new,string)
  333.     returns 'string' with all occurances of 'old' changed to 'new'
  334.         Example:                            Result:
  335.         RonSet X=replace(123,xxx,212311233) X=2xxx1xxx3
  336.  
  337.  
  338. Comparing strings
  339. -----------------
  340.  
  341. eqs(x,y)
  342.     returns 1 if x is alphabetically equal to y, 0 otherwise
  343.         Example:                            Result:
  344.         RonSet X=eqs(A,B)                   X=0
  345.         RonSet X=eqs(A,A)                   X=1
  346.  
  347. nes(x,y)
  348.     returns 1 if x is alphabetically not equal to y, 0 otherwise
  349.         Example:                            Result:
  350.         RonSet X=nes(A,B)                   X=1
  351.         RonSet X=nes(A,A)                   X=0
  352.  
  353. lts(x,y)
  354.     returns 1 if x is alphabetically less than y, 0 otherwise
  355.         Example:                            Result:
  356.         RonSet X=lts(A,B)                   X=1
  357.         RonSet X=lts(A,A)                   X=0
  358.         RonSet X=lts(B,A)                   X=0
  359.  
  360. les(x,y)
  361.     returns 1 if x is alphabetically less than or equal to y, 0 otherwise
  362.         Example:                            Result:
  363.         RonSet X=les(A,B)                   X=1
  364.         RonSet X=les(A,A)                   X=1
  365.         RonSet X=les(B,A)                   X=0
  366.  
  367. gts(x,y)
  368.     returns 1 if x is alphabetically greater than y, 0 otherwise
  369.         Example:                            Result:
  370.         RonSet X=gts(A,B)                   X=0
  371.         RonSet X=gts(A,A)                   X=0
  372.         RonSet X=gts(B,A)                   X=1
  373.  
  374. ges(x,y)
  375.     returns 1 if x is alphabetically greater than or equal to y, 0 otherwise
  376.         Example:                            Result:
  377.         RonSet X=ges(A,B)                   X=0
  378.         RonSet X=ges(A,A)                   X=1
  379.         RonSet X=ges(B,A)                   X=1
  380.  
  381. alpha(string)
  382.     returns 1 if 'string' is entirely alphabetic characters, 0 otherwise
  383.         Example:                            Result:
  384.         RonSet X=alpha(abc123xyz)           X=0
  385.         RonSet X=alpha(abcXYZABC)           X=1
  386.  
  387. num(string)
  388.     returns 1 if 'string' is entirely numeric characters, 0 otherwise
  389.         Example:                            Result:
  390.         RonSet X=num(abc123xyz)             X=0
  391.         RonSet X=num(123987)                X=1
  392.  
  393. number(string)
  394.     returns 1 if 'string' is a number, 0 otherwise
  395.     just like num(), except this one allows '-', '+', and '.'
  396.         Example:                            Result:
  397.         RonSet X=number(abc123xyz)          X=0
  398.         RonSet X=number(123987)             X=1
  399.         RonSet X=number(-123.987)           X=1
  400.  
  401.  
  402. Getting input
  403. -------------
  404.  
  405. char(prompt,allowed,seconds)
  406.     returns a single character entered from the keyboard
  407.     optional 'prompt' will be displayed to the screen
  408.     optional 'allowed' restricts input to specified characters
  409.     optional 'seconds' sets a timeout for entering a key
  410.     if 'seconds' is used, a timer displays on-screen during last 10 seconds
  411.     if timeout or user presses enter, esc, or ctrl-C, this returns nothing
  412.         Example:                            Result:
  413.         RonSet X=char()                     X=char pressed
  414.         RonSet X=char(What?)                X=char pressed, with prompt
  415.         RonSet X=char(,XYZ)                 X=char pressed, XYZ only allowed
  416.         RonSet X=char(,,5)                  X=char pressed
  417.                                             X=nothing if timer expires
  418.         RonSet X=char(Really?,YyNn,5)       X=char pressed, YyNn only allowed
  419.                                             X=nothing if timer expires
  420.  
  421. string(prompt,maxlength)
  422.     returns a string as entered from the keyboard
  423.     optional 'prompt' will be displayed to the screen
  424.     optional 'maxlength' restricts input to 'maxlength' characters
  425.     default 'maxlength' if not specified is 80
  426.         Example:                            Result:
  427.         RonSet X=string()                   X=user's input, up to 80 chars
  428.         RonSet X=string(Your name:)         X=user's input, with prompt
  429.         RonSet X=string(Really?,1)          X=user's input, up to 1 char
  430.  
  431.  
  432. Exit errorlevel
  433. ---------------
  434. Normally RONSET exits with errorlevel 0.  In the event of an error, it will
  435. exit with errorlevel 255 after displaying an error message.
  436.  
  437. level(value)
  438.     exit with errorlevel 'value' immediately
  439.     this does an immediate exit and doesn't set any environment variables
  440.     the command line environment variable is still required, but not used
  441.         Example:                            Result:
  442.         RonSet X=string(Your name:)         X=Ron Bemis
  443.         RonSet X=level(len(%X%))            X=Ron Bemis (still)
  444.         If Not Errorlevel 1 Goto NoName
  445.  
  446.         This example is meant to be taken as a batch file fragment rather
  447.         than as separate examples.  It illustrates the fact that if you use
  448.         the level() function, the variable specified to the left of the
  449.         equal sign is not effected.  Note that the %X% notation only works
  450.         in batch files, not from the command line.
  451.  
  452.  
  453. Filenames
  454. ---------
  455.  
  456. file(fspec)
  457.     returns the base filename and extension of 'fspec'
  458.     wildcards are not expanded
  459.     no check is made for the file's existance
  460.         Example:                            Result:
  461.         RonSet F=file(c:\dos\command.com)   F=command.com
  462.         RonSet F=file(E:\UTIL\*.BAT)        F=*.BAT
  463.  
  464. name(fspec)
  465.     returns only the base filename of 'fspec'
  466.     wildcards are not expanded
  467.     no check is made for the file's existance
  468.         Example:                            Result:
  469.         RonSet F=name(c:\dos\command.com)   F=command
  470.         RonSet F=name(E:\UTIL\*.BAT)        F=*
  471.  
  472. ext(fspec)
  473.     returns only the extension of 'fspec'
  474.     wildcards are not expanded
  475.     no check is made for the file's existance
  476.         Example:                            Result:
  477.         RonSet F=ext(c:\dos\command.com)    F=.com
  478.         RonSet F=ext(E:\UTIL\*.BAT)         F=.BAT
  479.         RonSet F=ext(c:\test)               F=      (not set)
  480.  
  481. drive(fspec)
  482.     returns only the drive letter and ":" of 'fspec'
  483.     no check is made for the file's existance
  484.     no check is made to see if the drive is valid
  485.         Example:                            Result:
  486.         RonSet F=drive(c:\dos\command.com)  F=c:
  487.         RonSet F=drive(E:\UTIL\*.BAT)       F=E:
  488.  
  489. path(fspec)
  490.     returns only the directory path of 'fspec'
  491.     no check is made for the file's existance
  492.     no check is made to see if the directory path is valid
  493.         Example:                            Result:
  494.         RonSet F=path(c:\dos\command.com)   F=\dos\
  495.         RonSet F=path(E:\UTIL\*.BAT)        F=\UTIL\
  496.  
  497. full(fspec)
  498.     returns the fully-qualified filespec of 'fspec'
  499.     wildcards are not expanded
  500.     current drive and path are used if 'fspec' does not contain them
  501.     if 'fspec' is not specified, current drive and path are returned
  502.         Example:                            Result:
  503.         RonSet F=full(command.com)          F=D:\MY\CURDIR\COMMAND.COM
  504.         RonSet F=full(E:*.BAT)              F=E:\CURDIR\ON_DR_E\*.BAT
  505.         RonSet F=full()                     F=D:\MY\CURDIR\
  506.  
  507. dir(drive)
  508.     returns the drive letter, ":" and current directory path of 'drive'
  509.     if 'drive' is not specified, current drive is used
  510.         Example:                            Result:
  511.         RonSet F=dir()                      F=D:\MY\CURDIR\
  512.         RonSet F=dir(D)                     F=D:\MY\CURDIR\
  513.         RonSet F=dir(E)                     F=E:\CURDIR\ON_DR_E\
  514.  
  515. exist(fspec)
  516.     returns 1 if 'fpsec' exists, 0 otherwise
  517.     wildcards are allowed
  518.         Example:                            Result:
  519.         RonSet X=exist(C:\AUTOEXEC.BAT)     X=1
  520.         RonSet X=exist(C:\GONE\MISSING.*)   X=0
  521.  
  522. expand(fspec)
  523.     returns the fully-qualified filespec of 'fspec'
  524.     if wildcards exist, they are expanded and the first match is returned
  525.     if 'fspec' is not specified, current drive and path are returned
  526.         Example:                            Result:
  527.         RonSet X=expand(C:\*.BAT)           X=C:\AUTOEXEC.BAT
  528.         RonSet X=expand(C:\WORK\*.OBJ)      X=C:\WORK\MYPROG.OBJ
  529.  
  530. size(fpsec)
  531.     returns the size of 'fspec'
  532.     if wildcards exist, the size of the first match is returned
  533.         Example:                            Result:
  534.         RonSet S=size(C:\AUTOEXEC.BAT)      S=3289
  535.  
  536. fdate(fpsec)
  537.     returns the date of 'fspec'
  538.     if wildcards exist, the date of the first match is returned
  539.     the format is suitable for string comparisons against other file dates
  540.         Example:                            Result:
  541.         RonSet S=fdate(C:\AUTOEXEC.BAT)     S=1990-02-06 14:56:26
  542.  
  543. wild(fspec)
  544.     returns 1 if 'fspec' contains wildcards, 0 otherwise
  545.         Example:                            Result:
  546.         RonSet W=wild(C:*.c)                W=1
  547.         RonSet W=wild(D:\utils\myprog.c)    W=0
  548.  
  549. diff(fspec1,fspec2)
  550.     returns 0 if files are identical
  551.     returns 1 if 'fspec1' is missing
  552.     returns 2 if 'fspec2' is missing
  553.     returns 3 if files are different
  554.         Example:
  555.         RonSet D=diff(test.old,test.new)
  556.  
  557. attr(fspec)
  558.     returns the attributes of 'fspec'
  559.     return value is created by ORing these bit values together:
  560.     bit 0   0x01    Read-only
  561.     bit 1   0x02    Hidden
  562.     bit 2   0x04    System
  563.     bit 4   0x10    Directory
  564.     bit 5   0x20    Archive
  565.         Example:                            Result:
  566.         RonSet A=attr(C:\AUTOEXEC.BAT)      A=32    (archive)
  567.         RonSet A=attr(C:\OS2KRNL)           A=7     (system,hidden,read-only)
  568.         RonSet A=attr(C:\DOS)               A=16    (directory)
  569.  
  570.  
  571. Peeking into files
  572. ------------------
  573. These functions all return unsigned numbers.
  574.  
  575. byte(location,filespec)
  576.     returns a byte (8 bits) at 'location' in 'filespec'
  577.     'location' is relative to zero (i.e. the first byte is at location 0)
  578.         Example:                            Result:
  579.         RonSet B=byte(2,C:\autoexec.bat)    B=99   'c' of @Echo Off
  580.  
  581. word(location,filespec)
  582.     returns a word (16 bits) at 'location' in 'filespec'
  583.     'location' is relative to zero (i.e. the first word is at location 0)
  584.         Example:                            Result:
  585.         RonSet W=word(0,C:\UTIL\RONSET.EXE) W=23117   'MZ' on every .EXE
  586.  
  587. long(location,filespec)
  588.     returns a longword (32 bits) at 'location' in 'filespec'
  589.     'location' is relative to zero (i.e. the first longword is at location 0)
  590.         Example:
  591.         RonSet L=long(8192,NODELIST.IDX)
  592.  
  593.  
  594. Sound
  595. -----
  596.  
  597. sound(len,tone...)
  598.     'len' specifies the length in milliseconds for each tone to play
  599.     'tone' is the frequency of the tone to play
  600.     returns a null string
  601.     missing tones are "held" tones (i.e. two commas together)
  602.     a 'tone' of 0 is silence
  603.         Example:                            Result:
  604.         RonSet X=Sound(500,440,,880)        Plays middle C for 1 second
  605.                                             and high C for 1/2 second
  606.         RonSet X=Sound(200,440,440,440)     Plays middle C 3 times
  607.  
  608.  
  609. Miscellaneous
  610. -------------
  611.  
  612. echo(string)
  613.     displays 'string' to the standard output
  614.     returns 'string'
  615.         Example:                            Result:
  616.         RonSet JBrown=echo(I feel good!)    JBROWN=I feel good!  (with output)
  617.  
  618. exec(doscommand)
  619.     executes 'doscommand' and returns the errorlevel
  620.         Example:                            Result:
  621.         RonSet X=exec(PkUnZip)              X=10    (no parameters)
  622.         RonSet X=exec(command /c dir)       X=0
  623.  
  624. free(drive)
  625.     returns amount of free space on 'drive'
  626.     if 'drive' is not specified, current drive is assumed
  627.         Example:                            Result:
  628.         RonSet F=free()                     F=12959744
  629.         RonSet F=free(c)                    F=12969744
  630.         RonSet F=free(d)                    F=23943168
  631.  
  632. total(drive)
  633.     returns total amount of space on 'drive'
  634.     if 'drive' is not specified, current drive is assumed
  635.         Example:                            Result:
  636.         RonSet S=total()                    F=33454080
  637.         RonSet S=total(d)                   F=33454080
  638.  
  639. mem()
  640.     returns total amount of free memory
  641.     any parameters are ignored
  642.     this value does not include the memory used by RONSET
  643.         Example:                            Result:
  644.         RonSet F=mem()                      F=360280
  645.  
  646. tenv()
  647.     returns total environment space
  648.     any parameters are ignored
  649.         Example:                            Result:
  650.         RonSet T=tenv()                     T=1024
  651.  
  652. env()
  653.     returns amount of free environment space
  654.     any parameters are ignored
  655.     this value is calculated before RONSET sets its variable
  656.         Example:                            Result:
  657.         RonSet T=env()                      T=263
  658.  
  659. ver(type)
  660.     returns the DOS version number
  661.     if 'type' is "major", the major number is returned (3)
  662.     if 'type' is "minor", the minor number is returned (30)
  663.     if 'type' is "both", both are returned (3.30)
  664.     if 'type' is not specified, "both" is assumed
  665.         Example:                            Result:
  666.         RonSet V=ver()                      V=3.30      (DOS 3.3)
  667.         RonSet V=ver()                      V=10.10     (OS/2 V1.1)
  668.         RonSet V=ver(major)                 V=3         (DOS 3.X)
  669.         RonSet V=ver(minor)                 V=10        (DOS X.1)
  670.         RonSet V=ver(both)                  V=2.11      (DOS 2.11)
  671.  
  672. if(test,true,false)
  673.     returns 'false' if the value of 'test' is 0, returns 'true' otherwise
  674.     if 'true' is not specified, nothing is returned when 'test' is non-zero
  675.     if 'false' is not specified, nothing is returned when 'test' is zero
  676.         Example:                            Result:
  677.         RonSet M=if(lt(ver(major),9),D,R)   M=D  (DOS version < 9.0)
  678.                                             M=R  (OS/2 real mode)
  679.         RonSet Prompt=concat($P,if(lt(ver(major),9),*$G,$G))
  680.                                             PROMPT=$P*$G (DOS version < 9.0)
  681.                                             PROMPT=$P$G  (OS/2 real mode)
  682.  
  683.         It's important to remember the order that expressions are evaluated
  684.         when using this function.  Both 'true' and 'false' are evaluated
  685.         before the 'if' function is evaluated.  This function is useful for
  686.         returning a value based on a test, not for conditional execution.
  687.         For example, this won't work:
  688.  
  689.             if(0,exec(command /c delete *.bat),echo(No!))
  690.  
  691.         because both the exec() and the echo() functions will be executed
  692.         before the if() function is.
  693.  
  694. prn()
  695.     returns printer status - created by ORing these bit values together:
  696.     bit 0   0x01    Device time out
  697.     bit 3   0x08    I/O error
  698.     bit 4   0x10    Selected
  699.     bit 5   0x20    Out of paper
  700.     bit 6   0x40    Acknowledge
  701.     bit 7   0x80    Not busy
  702.     any parameters are ignored
  703.         Example:                            Result:
  704.         RonSet P=prn()                      P=144  (0x90 - online)
  705.                                             P=24   (0x18 - offline)
  706.                                             P=200  (0xC8 - printer off)
  707.  
  708. rand(max)
  709.     returns a random number in the range 0 to 'max'-1
  710.         Example:
  711.         RonSet X=rand(5)                    X=0,1,2,3 or 4
  712.  
  713.  
  714. FidoNet
  715. -------
  716. These functions will probably be worthless to you unless you operate a node
  717. in the FidoNet nodelist.  An 'address' may have any of the following forms:
  718.     zone:net/node.point     (full address)
  719.     zone:net/node           (point 0 assumed)
  720.     net/node.point          (same zone assumed)
  721.     net/node                (same zone, point 0 assumed)
  722.     node.point              (same zone and net assumed)
  723.     node                    (same zone and net, point 0 assumed)
  724.     .point                  (same zone, net and node assumed)
  725.  
  726. zone(address)
  727.     returns the zone portion of the specified address
  728.         Example:                            Result:
  729.         RonSet Z=zone(1:124/1113)           Z=1
  730.         RonSet Z=zone(2:760/5.15)           Z=2
  731.  
  732. net(address)
  733.     returns the net portion of the specified address
  734.         Example:                            Result:
  735.         RonSet N=net(1:124/1113)            N=124
  736.         RonSet N=net(2:760/5.15)            N=760
  737.  
  738. node(address)
  739.     returns the node portion of the specified address
  740.         Example:                            Result:
  741.         RonSet N=node(1:124/1113)           N=1113
  742.         RonSet N=node(2:760/5.15)           N=5
  743.  
  744. point(address)
  745.     returns the point portion of the specified address
  746.         Example:                            Result:
  747.         RonSet P=point(1:124/1113)          P=      (not set)
  748.         RonSet P=point(2:760/5.15)          P=15
  749.  
  750. lookup(name)
  751.     returns the address of the specified name
  752.     'name' should be in the format "First Last" (without the quotes)
  753.     last name is optional
  754.     USERLIST.DOG is searched first if it exists, then FIDOUSER.LST
  755.     if BBS is defined, these files must be located there (SET BBS=C:\OPUS)
  756.     if BBS is undefined, these files must be in the current directory
  757.     most nodelist compilers can generate FIDOUSER.LST for you
  758.     each line in the file must be exactly the same length
  759.     both files must be sorted alphabetically
  760.         Example:                            Result:
  761.         RonSet N=lookup(Ron Bemis)          P=124/1113
  762.         RonSet N=lookup(Croc Dundee)        P=3:777/123.5
  763.  
  764.  
  765. Date and time
  766. -------------
  767. The date() and time() functions work identically with one exception:  if
  768. there are no parameters, date() uses a default parameter of "K, W d, Y", and
  769. time() uses a default parameter of "h:0m:0s".  If parameters are included,
  770. they are interpretted as follows:
  771.  
  772. j   the julian (actually gregorian) date (1-366)
  773. _j  same as above, but space-padded on the left to three characters
  774. 0j  same as above, but 0-padded on the left to three digits
  775.     the capital letter "J" may also be used instead of "j"
  776.  
  777. K   the day of the week, spelled out (Sunday-Saturday)
  778. k   the first three letters of the day of the week (Sun-Sat)
  779.  
  780. x   the day of the week, as a number (0-6)
  781.     the capital letter "X" may also be used instead of "x"
  782.  
  783. Y   the full 4-digit year
  784. y   the last two digits of the year
  785.  
  786. M   the month of the year, as a number (1-12)
  787. _M  same as above, but space-padded on the left to two characters
  788. 0M  same as above, but 0-padded on the left to two digits
  789.  
  790. W   the month of the year, spelled out (January-December)
  791. w   the first three letters of the month of the year (Jan-Dec)
  792.  
  793. d   the date of the month (1-31)
  794. _d  same as above, but space-padded on the left to two characters
  795. 0d  same as above, but 0-padded on the left to two digits
  796.     the capital letter "D" may also be used instead of "d"
  797.  
  798. h   the hour (0-23 or 1-12) see note below
  799. _h  same as above, but space-padded on the left to two characters
  800. 0h  same as above, but 0-padded on the left to two digits
  801.     the capital letter "H" may also be used instead of "h"
  802.  
  803.     Note:
  804.         If the am/pm notation is used, the hour will be returned as a
  805.         number between 1 and 12.  Otherwise, it will be returned as a
  806.         number between 0 and 23 (military time).  In other words, if you
  807.         include an "a", "A", "p", or "P" anywhere in the date() or time()
  808.         parameters, you'll get something between 1 and 12.  If you don't use
  809.         one of these, you'll get something between 0 and 23.
  810.  
  811. m   the minute (0-59)
  812. _m  same as above, but space-padded on the left to two characters
  813. 0m  same as above, but 0-padded on the left to two digits
  814.  
  815. s   seconds (0-59)
  816. _s  same as above, but space-padded on the left to two characters
  817. 0s  same as above, but 0-padded on the left to two digits
  818.     the capital letter "S" may also be used instead of "s"
  819.  
  820. a   am/pm notation (am-pm)
  821.     any of the letters "A", "p", or "P" may also be used instead of "a"
  822.     The use of this parameter causes a change in the way the hours are
  823.     displayed. See the note above.
  824.  
  825. "_" and "0" may be used only as prefixes on the parameters indicated above.
  826. If they are used elsewhere in the parameter string they are ignored.  All
  827. other characters in the parameters are copied as-is into the output string.
  828.  
  829.         Example:                            Result:
  830.         RonSet T=time()                     T=18:05:34
  831.         RonSet T=time(h:0m:0s)              T=18:05:34
  832.         RonSet T=time(h:0m:0sa)             T=6:05:34pm
  833.         RonSet D=date()                     D=Tuesday, February 6, 1990
  834.         RonSet D=date(K, W d, Y)            D=Tuesday, February 6, 1990
  835.         RonSet D=date(w d)                  D=Feb 6
  836.         RonSet S=date(0M/0d/y @ 0h:0m:0sa)  S=02/06/90 @ 06:05:34pm
  837.  
  838.  
  839.                          --- end of document ---
  840.  
  841.